home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
pcr
/
pcr4_4.lha
/
DIST
/
gc
/
GCCommands.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-18
|
2KB
|
86 lines
/* begincopyright
Copyright (c) 1988 Xerox Corporation. All rights reserved.
Use and copying of this software and preparation of derivative works based
upon this software are permitted. Any distribution of this software or
derivative works must comply with all applicable United States export
control laws. This software is made available AS IS, and Xerox Corporation
makes no warranty about the software, its performance or its conformity to
any specification. Any person obtaining a copy of this software is requested
to send their name and post office or electronic mail address to
PCRCoordinator.pa@xerox.com, or to:
PCR Coordinator
Xerox PARC
3333 Coyote Hill Rd.
Palo Alto, CA 94304
endcopyright */
/*
* GCCommands.c
*
* Veneer between CommandLoop.h and GC.h.
* This ought to be rationalized someday.
*
* Demers, April 9, 1990 2:37:31 pm PDT
*
*/
#include <xr/GC.h>
#include <xr/CommandLine.h>
#include <xr/CommandLoop.h>
static bool
XR_GCSetNeverCollectAtAllInverted(x)
bool x;
{
return( ! XR_GCSetNeverCollectAtAll( !x ) );
}
static unsigned
XR_GCGrowHeapTo(newVal)
unsigned newVal;
{
unsigned oldVal = XR_GCHeapSize();
if( newVal > oldVal ) {
(void) XR_Increase_Heap( newVal - oldVal );
}
return oldVal;
}
static
XR_CLPROC(XR_CLProc_gcollect)
{
XR_GCollect();
return 1;
}
static char *(GC_cmdDescriptions[]) = {
(char *)(XR_CLProc_setBool), (char *)(XR_GCSetNeverCollectAtAllInverted),
"[on|off] -- turn gc on or off",
"gc", NIL,
(char *)(XR_CLProc_setUnsigned), (char *)(XR_GCGrowHeapTo),
"n -- grow heap to at least n bytes",
"gcheapsize", "h", NIL,
(char *)(XR_CLProc_setBool), (char *)(XR_GCSetMarkCarefully),
"[on|off] -- set gc careful (but inefficient) marking mode",
"gcmarkcarefully", "gccareful", NIL,
(char *)(XR_CLProc_setUnsigned), (char *)(XR_SetBytesAfterWhichToCollect),
"n -- set bytes after which to collect",
"gccollectafter", NIL,
(char *)(XR_CLProc_gcollect), NIL,
" -- initiate garbage collection",
"gcollect", NIL,
NIL
};
void
GC_RegisterCommands()
{
(void) XR_CLUnsafeRegisterProcs(
XR_globalCLProcsHandle, GC_cmdDescriptions );
}